class Point{
private:
int xpos, ypos;
public:
Point(int x, int y):xpos(x), ypos(y){}
void ShowPosition(){
cout<<'['<<xpos<<','<<ypos<<']'<<endl;
}
Point operator+(const Point& ref){
Point pos(xpos+ref.xpos, ypos+ref.ypos);
return pos;
}
friend Point operator-(const Point&, const Point&);
};
Point operator-(const Point& pos1, const Point& pos2){
Point pos(poas1.xpos-pos2.xpos, pos1.ypos-pos2.ypos);
return pos;
}
int main(void){
Point pos1(3, 4);
Point pos2(10, 20);
Point pos3=pos1+pos2;
Point pos4=pos1-pos2;
pos3.ShowPosition();
pos4.ShowPosition();
return 0;
}